<!DOCTYPE html>
<html>
    <head>
           <script>
       function myFunction01()
       {
           alert("Hello World");
       }
       function myFunction02(name ,job)
       {
           alert("Welcome" + name + ", the " + job);
       }

        </script>
    </head>
    <body>
        <h1>案例01 Javascript的函数</h1>
     <button onclick = "myFunction01()">点击这里</button>

<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<h1>案例02 带参数的函数</h1>
<strong>不能声明参数不同函数名相同的函数，后一个会吧前一个给覆盖掉</strong><br/>
<button onclick = "myFunction01('Bill Gates','CED')">点击这里</button>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<h1>案例03 带返回值的函数<h1>
    <p id="demo"></p>
    <script>
    function myFunction(a,b)
    {
        return a*b;
    }
    document.getElementById("demo").innerHTML = myFunction(2,4);
    </script>
    
    </body>


</html>